package com.x.chalk.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.x.chalk.dao.BrowseDao;
import com.x.chalk.dao.MoodDao;
import com.x.chalk.dto.MoodPageDto;
import com.x.chalk.entity.Browse;
import com.x.chalk.entity.Mood;
import com.x.chalk.service.intf.BrowseService;
import com.x.chalk.service.intf.MoodService;
import com.x.chalk.util.BaiduCensorUtil;
import com.x.chalk.vo.PageVo;
import com.x.chalk.vo.R;
import com.x.chalk.vo.parms.PageParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;
import java.util.Objects;


/**
 * @Author FSir
 * @create 2022/10/4 16:18
 */
@Service
public class BrowseServiceImpl implements BrowseService {
    @Autowired
    private BrowseDao browseDao;


    @Override
    public int add(Long uid, Long mid) {
        return  browseDao.insert(new Browse(uid,mid));
    }

    @Override
    public Browse queryOne(Long uid, Long mid) {
        LambdaQueryWrapper<Browse> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(Browse::getUid,uid);
        queryWrapper.eq(Browse::getMoodId,mid);
        return browseDao.selectOne(queryWrapper);
    }
}
